<template>
    <view class="content">
        <view class="tabs">
            <u-tabs 
                :list="list1" 
                @click="click"
                :itemStyle="itemStyle"
                :scrollable="false"
                >
            </u-tabs>
        </view>
        <u-tabs :list="list2" @click="click"></u-tabs>
		<view class="list">
			<view class="item" @click="order_info">
				<view class="item-up">
                    <view class="item-up-left">
                        	<view class="item-up-left-top">
                                <view class="item-logo">
                                    <image src="/static/images/logo_text.png" alt=""></image>
                                </view>
                                <view class="item-adress">宝安区实验中学</view>
                            </view>
                            <view class="item-up-left-down">
                                <view class="item-creattime">2021-08-01 10:00-12:00</view>
                            </view>

                    </view>

					<view class="item-status">已完成</view>
				</view>
				<view class="item-middle">
					<view class="item-code">取餐码：<span>225</span></view>
					<view class="item-mobile">
                        <image src="/static/images/go.png" alt=""></image>
                        <span>联系门店</span>
                    </view>
					<view class="item-goadress">
                        <image src="/static/images/mobile.png" alt=""></image>
                        <span>前往门店</span>
                    </view>
				</view>
				<view class="item-down">
                    <view class="item-card">
                        <view class="item-pimg">
                            <image src="/static/images/product01.png" alt=""></image>
                        </view>
                        <view class="item-pinfo">
                            <view class="item-pname">龙井香青团</view>
                            <view class="item-pnote">大杯、珍珠、仙草、少冰、默认甜度</view>
                        </view>
                    </view>
                    <view class="item-pinfo2">
                        <view class="item-price">￥12.00</view>
                        <view class="item-num">x2</view>
                    </view>


				</view>
				<view class="item-btn">
                    <view class="btn" >
                         <u-button class="btn-primary" type="primary" :plain="true" :hairline="true" text="再来一单"></u-button>
                    </view>
                   
                </view>
			</view>
		</view>

    </view>
</template>

<script>
export default {
    data() {
        return {
            title: 'Hello',
            disabled: false,  // 添加 disabled 数据属性
            list1: [
                {
                    name: '今日订单',
                }, 
                {
                    name: '历史订单',
                }, 
            ],
			list2: [
                {
                    name: '堂食',
                }, 
                {
                    name: '外卖',
                }, 
            ],
            itemStyle: {
                width:'80px',
                height: '45px',
                lineHeight: '45px',
                textAlign: 'center',
            }
        }
    },
    onLoad() {
        console.log('页面加载完成');
    },
    methods: {
 		click(item) {
            console.log('item', item);
        },
        order_info() {
            console.log('订单详情');
            uni.navigateTo({
                url: '/pages/order/order_details?id=1'
            });
        },

    }
}


</script>

<style lang="scss">
.tabs{
    width: 200px;
    margin: 0 auto;
}
.list{
    width: 95%;
    margin: 0 auto;
    margin-top: 15px;
    .item{
        width: 100%;
        // 由上到下渐变背景  80%地方结束
        background: linear-gradient(to bottom, #48be19, #fff 60%);
        // background-color: aquamarine;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction:column;
        border-radius: 8px;
        box-shadow: 0 0 5px 1px #ececec;

        .item-up{
            height: 62px;
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            .item-up-left{
                width: 60%;
                display: flex;
                justify-content: space-between;
                align-items: flex-start;
                flex-direction: column;
                .item-up-left-top{
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    margin-left: 10px;
                    // flex-direction: column;
                    .item-logo{
                        width: 28px;
                        height: 15px;
                        // border: 1px solid #ccc;
                        overflow: hidden;
                        image{
                            width: 25px;
                            height: 20px;
                            padding: 0;
                            margin: 0;
                        }
                    }
                    .item-adress{
                        font-size: 16px;
                        color: #000000;
                        margin-left: 10px;
                    }

                }
                .item-up-left-down{
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    .item-creattime{
                        font-size: 14px;
                        color: #646464;
                        margin-left: 10px;
                    }
                }
             
            }
            .item-status{
                font-size:16px;
                color: #999;
                margin-right: 10px;
            }
        }
        .item-middle{
            height: 70px;
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            .item-code{
                height: 50px;
                width: 50%;
                font-size: 18px;
                color: #333;
                margin: 10px;
                border-radius: 8px;
                background-color: #e4e4e450;
                box-shadow: 0 0 8px #05050520;
                display: flex;
                justify-content: center;
                align-items: center;
                span{
                    color: rgb(0, 234, 43);
                    font-weight: bold;
                }
            }
            .item-mobile,.item-goadress{
                width: 20%;
                display: flex;
                justify-content: center;
                align-items: center;
                flex-direction: column;
                image{
                    width: 20px;
                    height: 20px;
                    // border: 1px solid #ccc;
                    padding: 5px;
                    background-color: #f1f1f150;
                    border-radius: 50%;
                }
                span{
                    font-size: 12px;
                    color: #333;
                }
            }
        }
        .item-down{
            height: 70px;
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #f1f1f1;
            .item-card{
                width: 70%;
                height: 100%;
                display: flex;
                justify-content: start;
                align-items: center;
                .item-pimg{
                    width: 50px;
                    height: 50px;
                    border: 1px solid #ccc;
                    background-color: #ccc;
                    border-radius: 5px;
                    margin-left: 10px;
                    overflow: hidden;
                    image{
                        width: 100%;
                        height: 100%;
                    }
                }
                .item-pinfo{
                    width: calc(100% - 60px);
                    height: 100%;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    flex-direction: column;
                    text-indent: 8px;
                    .item-pname{
                        width: 100%;
                        font-size: 16px;
                        color: #333;
                    }
                    .item-pnote{
                        width: 100%;
                        font-size: 12px;
                        color: #999;
                        margin-top: 5px;
                        // 溢出省略号
                        white-space: nowrap;
                        text-overflow: ellipsis;
                        overflow: hidden;
                    }
                }
            }
            .item-pinfo2{
                width: 20%;
                height: 100%;
                display: flex;
                justify-content: center;
                align-items: flex-end;
                flex-direction: column;
                margin-right: 10px;
                .item-price{
                    font-size: 14px;
                    color: #333;
                    margin-top: 10px;
                }
                .item-num{
                    font-size: 14px;
                    color: #333;
                    margin-top: 5px;
                }
            }
        }
        .item-btn{
            width: 100%;
            height: 40px;
            display: flex;
            justify-content: end;
            align-items: center;
            .btn{
                width: 100px;
                height: 30px;
                .btn-primary{
                    width: 80px;
                    height: 30px;
                }
            }
        }
    }
}
</style>
